// 格式化时间

import dayjs from 'dayjs'

export const formatDate = (date, formatter = 'YYYY-MM-DD') => (date && dayjs(date).format(formatter)) || ''

export const dateToYMD = date => formatDate(date)

export const dateToYMDHms = date => formatDate(date, 'YYYY-MM-DD HH:mm:ss')
